package scauCmiScaffolding.compiled;

import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Template;
import org.eclipse.jet.JET2Writer;
import org.eclipse.jet.taglib.RuntimeTagElement;
import org.eclipse.jet.taglib.TagInfo;

public class _jet_propertiesEditor implements JET2Template {
    private static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
    private static final String _jetns_java = "org.eclipse.jet.javaTags"; //$NON-NLS-1$

    public _jet_propertiesEditor() {
        super();
    }

    private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
    
    private static final TagInfo _td_c_get_1_9 = new TagInfo("c:get", //$NON-NLS-1$
            1, 9,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$packageName", //$NON-NLS-1$
            } );
    private static final TagInfo _td_java_importsLocation_2_1 = new TagInfo("java:importsLocation", //$NON-NLS-1$
            2, 1,
            new String[] {
                "package", //$NON-NLS-1$
            },
            new String[] {
                "org.example", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_3_8 = new TagInfo("c:get", //$NON-NLS-1$
            3, 8,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$packageName", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_4_8 = new TagInfo("c:get", //$NON-NLS-1$
            4, 8,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$packageName", //$NON-NLS-1$
            } );
    private static final TagInfo _td_java_import_12_2 = new TagInfo("java:import", //$NON-NLS-1$
            12, 2,
            new String[] {
            },
            new String[] {
            } );
    private static final TagInfo _td_c_get_13_14 = new TagInfo("c:get", //$NON-NLS-1$
            13, 14,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_java_import_13_80 = new TagInfo("java:import", //$NON-NLS-1$
            13, 80,
            new String[] {
            },
            new String[] {
            } );
    private static final TagInfo _td_java_import_15_3 = new TagInfo("java:import", //$NON-NLS-1$
            15, 3,
            new String[] {
            },
            new String[] {
            } );
    private static final TagInfo _td_c_get_16_10 = new TagInfo("c:get", //$NON-NLS-1$
            16, 10,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_16_64 = new TagInfo("c:get", //$NON-NLS-1$
            16, 64,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "lowercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_24_15 = new TagInfo("c:get", //$NON-NLS-1$
            24, 15,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "lowercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_24_73 = new TagInfo("c:get", //$NON-NLS-1$
            24, 73,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );

    public void generate(final JET2Context context, final JET2Writer __out) {
        JET2Writer out = __out;
        out.write("package ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_1_9 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_1_9); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_1_9.setRuntimeParent(null);
        _jettag_c_get_1_9.setTagInfo(_td_c_get_1_9);
        _jettag_c_get_1_9.doStart(context, out);
        _jettag_c_get_1_9.doEnd();
        out.write(".propertyEditor;");  //$NON-NLS-1$        
        out.write(NL);         
        RuntimeTagElement _jettag_java_importsLocation_2_1 = context.getTagFactory().createRuntimeTag(_jetns_java, "importsLocation", "java:importsLocation", _td_java_importsLocation_2_1); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_java_importsLocation_2_1.setRuntimeParent(null);
        _jettag_java_importsLocation_2_1.setTagInfo(_td_java_importsLocation_2_1);
        _jettag_java_importsLocation_2_1.doStart(context, out);
        _jettag_java_importsLocation_2_1.doEnd();
        out.write(NL);         
        out.write("import ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_3_8 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_3_8); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_3_8.setRuntimeParent(null);
        _jettag_c_get_3_8.setTagInfo(_td_c_get_3_8);
        _jettag_c_get_3_8.doStart(context, out);
        _jettag_c_get_3_8.doEnd();
        out.write(".dao.*;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_4_8 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_4_8); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_4_8.setRuntimeParent(null);
        _jettag_c_get_4_8.setTagInfo(_td_c_get_4_8);
        _jettag_c_get_4_8.doStart(context, out);
        _jettag_c_get_4_8.doEnd();
        out.write(".domain.*;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.beans.PropertyEditorSupport;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.io.Serializable;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.HashSet;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.Set;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import org.springframework.beans.factory.annotation.Autowired;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import org.springframework.stereotype.Component;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("@");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_java_import_12_2 = context.getTagFactory().createRuntimeTag(_jetns_java, "import", "java:import", _td_java_import_12_2); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_java_import_12_2.setRuntimeParent(null);
        _jettag_java_import_12_2.setTagInfo(_td_java_import_12_2);
        _jettag_java_import_12_2.doStart(context, out);
        JET2Writer _jettag_java_import_12_2_saved_out = out;
        while (_jettag_java_import_12_2.okToProcessBody()) {
            out = out.newNestedContentWriter();
            out.write("org.springframework.stereotype.Component");  //$NON-NLS-1$        
            _jettag_java_import_12_2.handleBodyContent(out);
        }
        out = _jettag_java_import_12_2_saved_out;
        _jettag_java_import_12_2.doEnd();
        out.write(NL);         
        out.write("public class ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_13_14 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_13_14); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_13_14.setRuntimeParent(null);
        _jettag_c_get_13_14.setTagInfo(_td_c_get_13_14);
        _jettag_c_get_13_14.doStart(context, out);
        _jettag_c_get_13_14.doEnd();
        out.write("sEditor extends ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_java_import_13_80 = context.getTagFactory().createRuntimeTag(_jetns_java, "import", "java:import", _td_java_import_13_80); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_java_import_13_80.setRuntimeParent(null);
        _jettag_java_import_13_80.setTagInfo(_td_java_import_13_80);
        _jettag_java_import_13_80.doStart(context, out);
        JET2Writer _jettag_java_import_13_80_saved_out = out;
        while (_jettag_java_import_13_80.okToProcessBody()) {
            out = out.newNestedContentWriter();
            out.write("java.beans.PropertyEditorSupport");  //$NON-NLS-1$        
            _jettag_java_import_13_80.handleBodyContent(out);
        }
        out = _jettag_java_import_13_80_saved_out;
        _jettag_java_import_13_80.doEnd();
        out.write("{");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("\t@");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_java_import_15_3 = context.getTagFactory().createRuntimeTag(_jetns_java, "import", "java:import", _td_java_import_15_3); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_java_import_15_3.setRuntimeParent(null);
        _jettag_java_import_15_3.setTagInfo(_td_java_import_15_3);
        _jettag_java_import_15_3.doStart(context, out);
        JET2Writer _jettag_java_import_15_3_saved_out = out;
        while (_jettag_java_import_15_3.okToProcessBody()) {
            out = out.newNestedContentWriter();
            out.write("org.springframework.beans.factory.annotation.Autowired");  //$NON-NLS-1$        
            _jettag_java_import_15_3.handleBodyContent(out);
        }
        out = _jettag_java_import_15_3_saved_out;
        _jettag_java_import_15_3.doEnd();
        out.write(NL);         
        out.write("\tprivate ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_16_10 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_16_10); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_16_10.setRuntimeParent(null);
        _jettag_c_get_16_10.setTagInfo(_td_c_get_16_10);
        _jettag_c_get_16_10.doStart(context, out);
        _jettag_c_get_16_10.doEnd();
        out.write("DAO ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_16_64 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_16_64); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_16_64.setRuntimeParent(null);
        _jettag_c_get_16_64.setTagInfo(_td_c_get_16_64);
        _jettag_c_get_16_64.doStart(context, out);
        _jettag_c_get_16_64.doEnd();
        out.write("DAO;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setAsText(String str) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tSet<Serializable> set = new HashSet();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tif(str.length()>0) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tString[] idStringSet = str.split(\",\");");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tif(idStringSet!=null)");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\tfor(String idString:idStringSet) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t\tset.add( ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_24_15 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_24_15); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_24_15.setRuntimeParent(null);
        _jettag_c_get_24_15.setTagInfo(_td_c_get_24_15);
        _jettag_c_get_24_15.doStart(context, out);
        _jettag_c_get_24_15.doEnd();
        out.write("DAO.find");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_24_73 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_24_73); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_24_73.setRuntimeParent(null);
        _jettag_c_get_24_73.setTagInfo(_td_c_get_24_73);
        _jettag_c_get_24_73.doStart(context, out);
        _jettag_c_get_24_73.doEnd();
        out.write("ById(Integer.parseInt(idString)));\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tthis.setValue(set);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\telse");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tthis.setValue(null);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("}");  //$NON-NLS-1$        
    }
}
